package com.sc.nft.admin.controller;


import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.admin.request.PageAdminProductStockDetailRequest;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.vo.AdminProductStockDetailVO;
import com.sc.nft.entity.vo.AdminReportBalanceVO;
import com.sc.nft.service.AdminProductStockDetailService;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;

/**
 * 后台调整商品库存记录表服务控制器
 *
 * @author Tangzehui
 * @since 2023-11-30 10:19:14
 * @description 
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/productStockDetail")
@Api(tags = "后台调整商品库存记录")
public class AdminProductStockDetailController {
    private final AdminProductStockDetailService adminProductStockDetailService;

    @PostMapping(value = "/pageAdmin", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "分页获取商品库存调整记录", notes = "获取平台数据概况", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AdminProductStockDetailVO> pageAdmin(@Valid @RequestBody PageAdminProductStockDetailRequest request) {
        Page<AdminProductStockDetailVO> result = adminProductStockDetailService.pageAdmin(request.getFirstTitle(),
                request.getIsAdd(), request.getStartTime(),request.getEndTime(),
                request.getPageSize(), request.getPageNo());
        return PageResult.success(result);
    }
}